package com.example.testone.utils

import android.os.Build;
import android.util.Log

object closeBar {
    fun close(){
        try{
            var ProcID = "79"
//            vc.
            ProcID = "42" // ICS AND NEWER
            // 需要root 权限
            // 需要root 权限
            val proc = Runtime.getRuntime().exec(
                arrayOf(
                    "su",
                    "-c",
                    "service call activity " + ProcID
                        .toString() + " s16 com.android.systemui"
                )
            ) // WAS 79

            proc.waitFor()
            Log.e("????","----")
        }catch (e:Exception){
            e.printStackTrace()
        }
    }

    /**
     * 显示底部导航条
     */
    fun showBar() {
        try {
            val proc = Runtime.getRuntime().exec(
                arrayOf(
                    "am", "startservice", "-n",
                    "com.android.systemui/.SystemUIService"
                )
            )
            proc.waitFor()
        } catch (e: java.lang.Exception) {
            e.printStackTrace()
        }
    }

}